import Vue from 'vue'
import App from './App.vue'
import router from './router'
// import store from './store'
import vueParticles from 'vue-particles'
import Vcomp from './components/index'
import Global from './assets/js/setHeight'
import VueLazyLoad from 'vue-lazyload'
// import ElementUI from 'element-ui'
// Vue.use(ElementUI, { size: 'small', zIndex: 3000 })
import { 
	Button,
	Row,
	Col,
	Carousel,
	CarouselItem,
	MessageBox,
	Message,
	Dialog ,
	Input,
	ButtonGroup,
	Loading
} from 'element-ui';


import '@/assets/styles/base.scss'
import '@/assets/styles/common.scss'
import '@/assets/iconfont/iconfont.css'
import 'element-ui/lib/theme-chalk/index.css'
import 'element-ui/lib/theme-chalk/display.css'

Message.install = function (Vue, options) {
	Vue.prototype.$message = Message
}
MessageBox.install = function (Vue, options) {
Vue.prototype.$messageBox = MessageBox
}


Vue.use(vueParticles)
Vue.use(Vcomp)
Vue.use(Button)
Vue.use(Row)
Vue.use(Col)
Vue.use(Carousel)
Vue.use(CarouselItem)
Vue.use(MessageBox)
Vue.use(Message)
Vue.use(Dialog)
Vue.use(Input)
Vue.use(ButtonGroup)
Vue.use(Loading)
// Vue.use(Loading.directive);
Vue.use(VueLazyLoad,{
	error:require('assets/img/img_01.jpg'), // 加载错误的图片
	loading:require('assets/img/img_01.jpg'), // 加载时的图片
	attempt: 1  , 
	listenEvents: ['animationend', 'transitionend']
});

Vue.prototype.$ELEMENT = { size: 'small', zIndex: 3000 }//按需引入全局设置大小
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$prompt = MessageBox.prompt
Vue.prototype.$message = Message




Vue.config.productionTip = false


Vue.prototype.$setFontSize = Global.setFontSize;    // 全局变量（高度、根字体大小）
Vue.prototype.$setHeight = Global.setHeight;  //浏览器可视窗口高度

router.beforeEach((to, from, next) => {
	if (to.meta.title) {
	  document.title = to.meta.title;
	}
	next();
})



new Vue({
  router,
  // store,
  render: h => h(App),
}).$mount('#app')
